<template>
  <div id="content">
    <div class="head Flex AC">
      <h1>呀呀系统</h1>
      <div class="demo-basic--circle portrait">
        <div class="block">
          <el-dropdown>
            <el-avatar :size="50" :src="circleUrl"> </el-avatar>
            <el-dropdown-menu   slot="dropdown" >
              <span @click="logoutClick()">
                <el-dropdown-item>登出</el-dropdown-item>
              </span>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </div>
      <!-- <i class="el-icon-user-solid portrait" @click="logoutClick()"></i> -->
    </div>
    <div class="Flex box">
      <el-container style="margin: 0px 0px">
        <el-aside width="220px">
          <el-menu
            :default-active="'1'"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#3B5D85"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-menu-item index="1" @click="accountInfo()">
              <i class="el-icon-user-solid"></i>
              <span>个人信息</span>
            </el-menu-item>
            <el-menu-item index="2" @click="Chart()">
              <i class="el-icon-menu"></i>
              <span slot="title">图表</span>
            </el-menu-item>
            <el-menu-item index="3" @click="Introduce()">
              <i class="el-icon-setting"></i>
              <span slot="title" >介绍</span>
            </el-menu-item>
            <el-menu-item index="4" @click="test()">
              <i class="el-icon-setting"></i>
              <span slot="title" >测试</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <router-view></router-view>
      </el-container>
    </div>
  </div>
</template>
<script>
export default {
  name: "index",
  data() {
    return {
      circleUrl: require("../../assets/images/portrait.png"),
    };
  },
  methods: {
    logoutClick() {
      this.$router.push("/");
    },
    accountInfo() {
      this.$router.push("/accountInfo");
    },
    Chart() {
      this.$router.push("/Chart");
    },
    Introduce(){
      this.$router.push("/introduce")
    },
    test(){
      this.$router.push("/test")
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>
<style lang="scss" scoped>
#content {
  width: 100%;
  height: 100%;
  .head {
    width: 100%;
    height: 100px;
    margin-top: 0;
    // position: absolute;
    background: rgb(52, 87, 128);
    h1 {
      left: 3%;
      color: #dfd7d7;
      position: relative;
    }
    .portrait {
      right: 2%;
      position: absolute;
    }
    .el-icon-user-solid:before {
      font-size: 30px;
    }
  }
  .el-menu {
    height: calc(100vh - 100px);
  }
  .el-main {
    width: calc(100vw - 220px);
    // height: calc(100vh - 100px);
    padding: 0;
  }
  .el-dropdown-link {
    cursor: pointer;
    color: #409eff;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
}
</style>